package com.sunsys.hbase.get.example;

import java.io.IOException;

import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.client.HTablePool;
import org.apache.hadoop.hbase.client.Result;

public class GetDemo {

	public void retriveData(String hTableName, String rowKey, String columnFamily ) throws IOException {
		
		HTablePool hTablePool = null;
		HTableInterface hTableInterface = null;
		Result result = null;
		
		hTablePool = new HTablePool();
		hTableInterface = hTablePool.getTable(hTableName.getBytes());
		/* Get Row associated with the RowKey */
		Get get = new Get(rowKey.getBytes());
		
		try {
			result = hTableInterface.get(get);
			System.out.println("have to retrive values from result object ");
		}catch(IOException e1) {
			throw e1;
		}
		
	}
	
	public static void main(String []args) throws IOException {
		
		GetDemo getDemo = new GetDemo();
		getDemo.retriveData("users", "key1", "info");
		
		System.out.println("Thanks for using");		
	}
}
